﻿using Business.Base;
using Business.Base.DB.DBRules;
using Business.Base.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Business.CentrifugalPump.Perf
{
    [Serializable]
    [DBTableAttribute("centrifugalpump_perf_experimentrecord")]
    public class CentrifugalPumpPerfExperimentRecord:ExperimentRecord
    {
        int id;
        String experimentCode;
     
        string experiment;


        Double workFlow;
        Double presureIn;
        Double presureOut;
        Double electricCurrent;
        Double voltage;
        Double workingPower;
        Double workingSpeed;
        Double temperature;
        Double workingHead;
        Double stpFlow;
        Double stpHead;
        Double stpShaftPower;
        Double stpPowerIn;
        Double stpPumpEfficiency;
        Double stpGroupEfficiency;
        Double workingStaticHead;
        Double workingDynamicHead;
        Double workingGeoHead;
        Double workingFrictionHead;

        public int Id { get => id; set => id = value; }
        public string ExperimentCode { get => experimentCode; set => experimentCode = value; }
        
        public string Experiment { get => experiment; set => experiment = value; }
        [DBFieldAttribute("workingHead")]
        public double WorkingHead { get => workingHead; set => workingHead = value; }
        [DBFieldAttribute("stpFlow")]
        public double StpFlow { get => stpFlow; set => stpFlow = value; }
        [DBFieldAttribute("stpHead")]
        public double StpHead { get => stpHead; set => stpHead = value; }
        [DBFieldAttribute("stpShaftPower")]
        public double StpShaftPower { get => stpShaftPower; set => stpShaftPower = value; }
        [DBFieldAttribute("stpPumpEfficiency")]
        public double StpPumpEfficiency { get => stpPumpEfficiency; set => stpPumpEfficiency = value; }
        [DBFieldAttribute("stpGroupEfficiency")]
        public double StpGroupEfficiency { get => stpGroupEfficiency; set => stpGroupEfficiency = value; }
        [DBFieldAttribute("workingStaticHead")]
        public double WorkingStaticHead { get => workingStaticHead; set => workingStaticHead = value; }
        [DBFieldAttribute("workingDynamicHead")]
        public double WorkingDynamicHead { get => workingDynamicHead; set => workingDynamicHead = value; }
        [DBFieldAttribute("workingGeoHead")]
        public double WorkingGeoHead { get => workingGeoHead; set => workingGeoHead = value; }
        [DBFieldAttribute("workingFrictionHead")]
        public double WorkingFrictionHead { get => workingFrictionHead; set => workingFrictionHead = value; }
        [DBFieldAttribute("stpPowerIn")]
        public double StpPowerIn { get => stpPowerIn; set => stpPowerIn = value; }

        public override string ToString()
        {

            StringBuilder sb = new StringBuilder();
            sb.Append(" WorkingHead:" + String.Format("{0, 6}", Decimal.Round( (Decimal)WorkingHead,4)));
            sb.Append(" StpFlow:" + String.Format("{0, 6}", Decimal.Round((Decimal)StpFlow, 4)));
            sb.Append(" StpHead:" + String.Format("{0, 6}", Decimal.Round((Decimal)StpHead, 4)));
            sb.Append(" StpShaftPower:" + String.Format("{0, 6}", Decimal.Round((Decimal)StpShaftPower, 4)));
            sb.Append(" StpPumpEfficiency:" + String.Format("{0, 6}", Decimal.Round((Decimal)StpPumpEfficiency, 4)));
            sb.Append(" StpGroupEfficiency:" + String.Format("{0, 6}", Decimal.Round((Decimal)StpGroupEfficiency, 4)));
            sb.Append(" WorkingStaticHead:" + String.Format("{0, 6}", Decimal.Round((Decimal)WorkingStaticHead, 4)));
            sb.Append(" WorkingDynamicHead:" + String.Format("{0, 6}", Decimal.Round((Decimal)WorkingDynamicHead, 4)));
            sb.Append(" WorkingFrictionHead:" + String.Format("{0, 6}", Decimal.Round((Decimal)WorkingFrictionHead, 4)));
            sb.Append(" StpPowerIn:" + String.Format("{0, 6}", Decimal.Round((Decimal)StpPowerIn, 4)));


            return base.ToString()+"  "+sb.ToString();
        }
    }
}
